package com.dhecp.project.flowable.mapper;
import com.dhecp.core.genericDao.GenericDao;
import com.dhecp.project.flowable.domain.SysProcessInstance;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


/**
 * @InterfaceName SysProcessInstanceMapper
 * @Description TODO
 * @Author alula
 * @Date 2019-11-29 15:36
 */
public interface SysProcessInstanceMapper extends GenericDao<SysProcessInstance, String> {

    SysProcessInstance findSysProcessInstanceByGuid(@Param("guid") String guid);

    SysProcessInstance findSysProcessInstanceByProcInstId(@Param("procInstId") String procInstId);

    SysProcessInstance findSysProcessInstanceByTableDataId(@Param("tableDataId") String tableDataId);

    int deleteSysProcessInstanceByGuid(@Param("guid") String guid);

    Integer findActProcessBranchResult(Map<String, Object> params);
    
    /**
     * 获取自定义审核用户列表
     * @param params
     * @return List - String
     * @author DH-Xxj
     */
    List<String> findActProcessDefinedUserList(Map<String, Object> params);

    int findSysProcessInstanceByProcDefIdToCount(@Param("procDefId") String procDefId);

    /**
     * 重置流程
     * @param sysProcessInstance
     * @return
     */
    int updateResetProcess(SysProcessInstance sysProcessInstance);

    /**
     * 更新流程备注
     * @param params
     * @return
     */
    int updateSysProcessToBusinessData(Map<String, Object> params);

    /**
     * 更新业务员流程状态
     * @param params
     * @return
     */
    int updateActProcessModuleDataState(Map<String, Object> params);

    /**
     * 插入指定单据流转各环节审批人记录
     * @param params
     * @return
     * @author DH-Xxj
     */
    int insertProcessInstanceFlowRecord(Map<String, Object> params);
    
}
